package com.yirui.serialcomm.core.parse;

import com.yirui.serialcomm.core.domain.SerialCommPacket;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author Dujie
 * @create 2025/8/13
 * @since 1.0.0
 */
public interface PacketParser{
    <T> T decode(InputStream inputStream)throws IOException;

    boolean matchHeader(InputStream inputStream);

    byte[] encode(SerialCommPacket packet) throws IOException;
}
